import { Injectable } from '@angular/core';
import {Request,Response} from "@angular/http";
import {Observable} from "rxjs/Rx";

@Injectable()
export class HttpInterceptorService {
  constructor(){
    console.log('HttpInterceptorService')
  }
  beforeRequest(request:Request){
    console.info('beforerequest--')
    console.log(request);
    console.info('beforerequest--end')
    return request;
  }
  afterResponse(res:Observable<Response>):Observable<any>{
    res.subscribe(data=>{
      console.info('afterResponse--')
      console.log(data);
       console.info('afterResponse--end')
    })
    return res;
  }

}
